<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../../common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>数据字典管理</title>
<jsp:include page="../../../common/head.jsp">
	<jsp:param name="_spPage" value="true"/>
</jsp:include>
		<script language="javaScript">	
	//添加附件类型
	function insUploadFileType()
	{
		window.location.href="insUploadFileType.do";
	}
	//修改附件类型
	function updUploadFileType(varId,sign)
	{
		if(sign=="S")
			alert("该附件类型为系统内定类型，不能修改！");
		else
			window.location.href="updUploadFileType.do?fileTypeId="+varId;
	}
	//删除附件类型
	function delUploadFileType(varId,sign)
	{
		if(sign=="s")
			alert("该附件类型为系统内定类型，不能删除！");
		else
			window.location.href="deleteUploadFileType.do?fileTypeId="+varId;
	}
	//更新缓存附件类型数据
	function updateApplication(){
		var tmp = parseInt(Math.random()*10000+1);//设定随机数防止浏览器以相同url重复多次访问不进行请求
		if(confirm("确认更新应用服务器中附件类型数据？"))
		{
			var url = 'updApplicationUploadFileType.do?t='+tmp;
			$.get(url, {},function (data, textStatus){
				if(data=="ok")
				{
					alert("更新服务器附件类型数据成功!");
				}
			});
		}
	}
</script>
	</head>
	<body>
	<form name="form1" action="listUploadFileType.do" method="post">
	<div id="body_div">
	<w:ShowTitle name="附件类型维护">
	<w:TitleButton funcName="查询" onClickFunction="_queryDivBg(this)" urlImg="${ctx}/images/main/query.png"/>
	<w:TitleButton funcName="刷新" onClickFunction="updateApplication()" urlImg="${ctx}/images/main/export.png"/>
	<w:TitleButton funcName="添加" onClickFunction="insUploadFileType()" urlImg="${ctx}/images/main/add.png"/>
	</w:ShowTitle>
	<div id="body_content">
			<div id="queryDiv">
				<table width="100%">
					<tr>
						<td colspan="4" class="td_title">
							附件类型查询
						</td>
					</tr>
					<tr>
						<td width="110">
							附件类型名称
						</td>
						<td width="120" class="left_align">
							<input name="uploadFileType.fileTypeName" type="text" value="${uploadFileType.fileTypeName}"/>
						</td>
						<td width="110">
							所属业务
						</td>
						<td class="left_align">
							<w:select name="uploadFileType.belongTable" value="${uploadFileType.belongTable}">
					   			<w:option optionLabel="请选择" optionValue=""></w:option>
					   			<w:options options="${belongTableList}" optionLabel="typeLable" optionValue="typeValue"></w:options>
					   		</w:select>
						</td>
					</tr>
					
					<tr>
						<td colspan="4">
							<input name="button" type="submit" class="btn_standard" value="　查 询" />
							<input name="button" type="button" class="btn_standard" onclick="_cancelQuery()" value="取消" />
						</td>
					</tr>
				</table>
			</div>	
				<table width="100%">
					<tr>
						<td colspan="4" class="warnText left_align">
							*更新附件类型后请点击“刷新”按钮更新服务器缓存数据使所做修改生效
						</td>
					</tr>
					<tr>
						<td class="td_title">
							附件类型名称
						</td>
						<td class="td_title">
							所属业务
						</td>
						<td class="td_title">
							描述
						</td>
						<td class="td_title">
							操作
						</td>
					</tr>
					<c:forEach items="${datalist}" var="obj">
						<tr>
							<td width="180">
								${obj.fileTypeName}
							</td>
							<td width="150">
								<c:forEach items="${belongTableList}" var="belongTableObj">
									<c:if test="${belongTableObj.typeValue eq obj.belongTable}">${belongTableObj.typeLable}</c:if>
								</c:forEach>
							</td>
							<td>
								${obj.remark}
							</td>
							<td width="80">
								<a href="#" onclick="updUploadFileType('${obj.fileTypeId}','${obj.fileTypeSign}')">修改</a>
								<a href="#" onclick="delUploadFileType('${obj.fileTypeId}','${obj.fileTypeSign}')">删除</a>
							</td>
						</tr>
					</c:forEach>
				</table>
				<w:spPage />
			</div>
	</div>
	</form>
	</body>
</html>




